package StructuralPatterns.Adapter;

public class MediaAdapter implements MediaPlayer {

  AdvancedMediaPlayer advancedMediaPlayer = null;

  public MediaAdapter(String type){
    if (type.equalsIgnoreCase("Vlc")){
      advancedMediaPlayer = new Vlc();
    }
    if (type.equalsIgnoreCase("Mp4")){
      advancedMediaPlayer = new Mp4();
    }
  }

  @Override
  public void play(String fileName,String type) {
    if (type.equalsIgnoreCase("Vlc")){
      advancedMediaPlayer.playVlc(fileName);
    }
    if (type.equalsIgnoreCase("Mp4")){
      advancedMediaPlayer.playMp4(fileName);
    }
  }
}
